{% extends 'Base/form_creator.html.twig' %}

{% block intro %}
{% endblock %}


{% block myJs %}
    <script>
        var Page
        $(function () {
            Page = createVM("#Page", {
                en:{{ show.vars.attr.en |raw }}
            }, {
                "init": function () {
                }
                , "submit": function () {
                    var _this = this
                    var form = createForm(_this.en);
                    apiPost("{{ show.vars.attr.action }}", form, function (res) {
                        if (res.s == 1) {
                            console.log(res.d);
                            goto(res.d)
                        }
                        showToast(res.i);
                    })
                }
                , ArratDelIndex: function (name, index) {
                    var data = this.en[name]
                    data = arrayDelIndex(data, index)
                    this.en[name] = data
                }
            })
            initPage()
        })
    </script>
{% endblock %}